package com.zhiche.lisa.bms.service.invoice;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zhiche.lisa.bms.dao.model.invoice.InvoiceReg;

import java.util.List;

/**
 * <p>
 * 发票登记 服务类
 * </p>
 *
 * @author hongbo
 * @since 2018-09-27
 */
public interface InvoiceRegService extends IService<InvoiceReg> {
    /**
     * 获取发票登记明细
     *
     * @param headerId
     * @return
     */
    List<InvoiceReg> selectInvoiceRegByHeaderId(Long headerId);

    /**
     * 新增发票登记信息
     *
     * @param invoiceReg
     */
    void insertOrUpdateInvoiceReg(InvoiceReg invoiceReg);

    /**
     * 批量新增发票登记信息
     *
     * @param invoiceRegs
     */
    void insertOrUpdateInvoiceRegList(List<InvoiceReg> invoiceRegs, Long headId);

    /**
     * 批量新增发票登记信息
     *
     * @param invoiceRegs
     * @param headerId
     */
    void insertInvoiceRegList(List<InvoiceReg> invoiceRegs, Long headerId);

    /**
     * 获取待付金额为空发票
     *
     * @param page
     * @return
     */
    Page<InvoiceReg> queryInvoiceRegOfNotLackSum(Page<InvoiceReg> page);

    /**
     * 更新发票已付金额
     *
     * @param invoiceRegList
     */
    void updateInvoiceReSum(List<InvoiceReg> invoiceRegList);

    /**
     * 无token查询
     *
     * @param headId
     * @return
     */
    List<InvoiceReg> selectInvoiceRegByHeadIdNoTenant(Long headId);

    /**
     * 删除
     *
     * @param headId
     */
    void deleteBatchByHeadId(Long headId);
}
